<?php
class App_View_Helper_teamImage{

	public function teamImage($teamID){

	  //Retrieving data from media for image
	 	  $imageCriteria  = new Criteria();
	  	  $imageCriteria->add(MediaPeer::OWNER_ID,$teamID,Criteria::EQUAL);
	  	  $imageCriteria->add(MediaPeer::TYPE,'team',Criteria::EQUAL);
	  	  $imageResult    = MediaPeer::doSelect($imageCriteria);
	  	  $imageResultCnt = MediaPeer::doCount($imageCriteria);  
				  	  
		
		$html="";		
		if($imageResultCnt > 0)
		{
			foreach($imageResult as $imageResult)
			{
				$baseUrl =Zend_Registry::get("baseUrl");
				$url =$baseUrl."files/team/".$imageResult->getFileName();
				$html.='<img src="'.$url.'" width="20px;" />';
			?>
	
			<?php }
			return $html;
		}
		
	}

}